package ink.xiaobaibai.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-05-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("client_order")
public class ClientOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    public ClientOrder() {
    }

    /**
     * id非自增
     */
    public ClientOrder(String orderId, Integer userId, BigDecimal orderAmount, Integer deviceId, Integer adminUserId, Integer adminDepId, Integer runTime) {
        this.orderId = orderId;
        this.userId = userId;
        this.orderAmount = orderAmount;
        this.deviceId = deviceId;
        this.adminUserId = adminUserId;
        this.adminDepId = adminDepId;
        this.runTime = runTime;
    }

    /**
     * 订单id
     */
    @TableId(value = "order_id")
    private String orderId;

    /**
     * 对应的用户id
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 订单金额(包月不在此列)
     */
    @TableField("order_amount")
    private BigDecimal orderAmount;

    /**
     * 对应的机器id
     */
    @TableField("device_id")
    private Integer deviceId;

    /**
     * 负责人id(用户可能被删除)
     */
    @TableField("admin_user_id")
    private Integer adminUserId;

    /**
     * 负责人所在部门id(部门可能被删除)
     */
    @TableField("admin_dep_id")
    private Integer adminDepId;

    /**
     * 本订单的机器运行时间
     */
    @TableField("run_time")
    private Integer runTime;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


}
